Class STPIUpscaler
Spatial-Temporal Post-processing (STP) exposed as an IUpscaler.
Inherited Members
Namespace: Global Namespace
Assembly: Unity.RenderPipelines.Core.Runtime.dll
Syntax
[UpscalerUnsupportedBuildTarget(new BuildTarget[] { }, graphicsDeviceTypes = new GraphicsDeviceType[] { GraphicsDeviceType.OpenGLES3 })]
[Preserve]
public class STPIUpscaler : AbstractUpscaler, IUpscaler, IRenderGraphRecorder
Fields
registeredId
Unique string ID for this upscaler. See upscalerId.
Declaration
public static readonly string registeredId
Field Value
| Type | Description |
|---|---|
| string |
registeredName
Display name for this upscaler.
Declaration
public static readonly string registeredName
Field Value
| Type | Description |
|---|---|
| string |
Properties
isSupportedOnDevice
Returns true if the upscaler can run on the current device.
Declaration
public override bool isSupportedOnDevice { get; }
Property Value
| Type | Description |
|---|---|
| bool |
Overrides
Remarks
Queried when selecting an upscaler, so it must be cheap. Implementations that need to probe hardware or a plugin should do so once and return the cached result.
isTemporal
Returns true if the upscaler uses temporal information from previous frames.
Declaration
public override bool isTemporal { get; }
Property Value
| Type | Description |
|---|---|
| bool |
Overrides
name
Gets the display name of the upscaler (e.g., "FSR2").
Declaration
public override string name { get; }
Property Value
| Type | Description |
|---|---|
| string |
Overrides
reactiveMaskSource
Returns the type of reactive mask that the upscaler requires.
Declaration
public override ReactiveMaskSource reactiveMaskSource { get; }
Property Value
| Type | Description |
|---|---|
| ReactiveMaskSource |
Overrides
supportsSharpening
Returns true if the upscaler supports sharpening within the upscaling pass.
Declaration
public override bool supportsSharpening { get; }
Property Value
| Type | Description |
|---|---|
| bool |
Overrides
upscalerId
Gets the stable identifier of the upscaler (e.g., "unity.stp"), which render pipeline assets serialize.
Declaration
public override string upscalerId { get; }
Property Value
| Type | Description |
|---|---|
| string |
Overrides
Remarks
Prefix the ID to keep it unique, and never change it once shipped: This is never localized and never shown to users.
Methods
CreateContext(UpscalerOptions, Vector2Int)
Creates a new context for this upscaler. Upscaler authors implement this to create per-camera state. Called by the context manager when a new camera needs upscaling or when an existing context is invalidated.
Declaration
public override IUpscalerContext CreateContext(UpscalerOptions options, Vector2Int displayResolution)
Parameters
| Type | Name | Description |
|---|---|---|
| UpscalerOptions | options | The upscaler options to create the context with. |
| Vector2Int | displayResolution | The target display resolution. |
Returns
| Type | Description |
|---|---|
| IUpscalerContext | A new context instance, or null for spatial upscalers that don't need context. |
Overrides
RecordRenderGraph(RenderGraph, ContextContainer)
This function is called during render graph recording and allows the implementing class to register the relevant passes and resources to the passed in render graph. To access information about the current execution context (current camera, ...) the ContextContainer can be queried. See the render pipeline documentation for more information on the types that are available in the context container. (The exact types available may differ based on the currently active render pipeline). This is where custom rendering occurs. Specific details are left to the implementation.
Declaration
public override void RecordRenderGraph(RenderGraph renderGraph, ContextContainer frameData)
Parameters
| Type | Name | Description |
|---|---|---|
| RenderGraph | renderGraph | The graph to register resources and passes with. |
| ContextContainer | frameData | A ContextContainer that allows querying information about the current execution context (.e.g. RenderPipeline camera info). |